package org.zachary.agent.domain.aggregate_model.token;

import jakarta.persistence.Embeddable;
import lombok.extern.slf4j.Slf4j;
import org.zachary.agent.domain.exception.TokenException;

import java.io.Serial;
import java.io.Serializable;

@Slf4j
@Embeddable
public class DeviceId implements Serializable {
    @Serial
    private static final long serialVersionUID = 1L;
    private String value;
    public DeviceId(String value) {
        if(value == null || value.isEmpty()){
            throw new TokenException("设备ID为空");
        }
        this.value=value;
    }

    protected DeviceId() {}

    public String getDeviceId() {
        return value;
    }
}
